<form id="{$form.name}" name="{$form.name}">
<link rel="stylesheet" href="{$js_url}/jquery-ui/ui-openbiz/jquery.css" type="text/css" />
{literal}
<style>
.ui-tabs-panel .input_row{
width:645px;
padding-bottom:0px;
}
.ui-tabs-panel .odd{
background-color:#f5f5f5;
width:645px;
}
.ui-tabs-panel table.input_row td.label_text{
padding-top:4px;
height:20px;
}
.ui-tabs-panel .input_row label {
padding-left:15px;
line-height:24px;
}
.input_row .column_bar .bar_bg{
margin-top:4px;
}
.input_row .column_bar .value{
margin-top:4px;
}
</style>
{/literal}
<div style="padding-left:35px; padding-right:30px;">
{include file="system_appbuilder_btn.tpl.html"}
	<div style="padding-left:0px;" >

	<h2><span class="title_id" style="margin-right:10px;">{$form.currentRecordId}</span>{$form.title}</h2>
	<table><tr><td>
		{if $form.icon !='' }
		<div class="form_icon"><img  src="{$form.icon}" border="0" /></div>
		{/if}
	
		<div style="float:left; width:600px;padding-top:8px;">
			{if $dataPanel.fld_form_title.element}
			<h1 style="padding-bottom:5px;">
			{$dataPanel.fld_form_title.element}
			</h1>
			{/if} 
			{if $dataPanel.fld_form_description.element}
			<div class="input_row" style="line-height:20px;padding-bottom:5px;">		
			{$dataPanel.fld_form_description.element}
			</div>
			{else}
			<div style="height:15px;"></div>
			{/if}
		</div>
	</td></tr></table>
	</div>

	<div class="element_set_panel">
			{assign var=item value=$dataPanel.fld_total_progress}	
			<table  class="input_row">				
			<tr>	
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
						
				<td>
					<span class="label_text" style="width:300px;">{$item.element}</span>
				</td>			
				{assign var=item value=$dataPanel.fld_priority}
			
				<td >			
					<label style="text-align:left;width:60px;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:150px;">{$item.element}</span>
				</td>	
			</tr> 
			</table>
			
			{assign var=item value=$dataPanel.fld_time_progress}	
			<table  class="input_row">				
			<tr>	

				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:300px;">{$item.element}</span>
				</td>							
		
			{assign var=item value=$dataPanel.fld_severity}		
				<td >			
					<label style="text-align:left;width:60px;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:150px;">{$item.element}</span>
				</td>		
			
			</tr> 
			</table>			
			
			
			{assign var=item value=$dataPanel.fld_spend_progress}	
			<table  class="input_row">				
			<tr>	
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:300px;">{$item.element}</span>
				</td>
	
						
			{assign var=item value=$dataPanel.fld_milestone}
	
				<td >			
					<label style="text-align:left;width:60px;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:150px;">{$item.element}</span>
				</td>					
		
			</tr> 
			</table>					
					


			
			<table  class="input_row">				
			<tr>	
				{assign var=item value=$dataPanel.fld_dependency}	
				
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_textarea" style="width:300px;overflow:hidden;">{$item.element}</span>
				</td>	
				{assign var=item value=$dataPanel.fld_status}
				<td >			
					<label style="text-align:left;width:60px;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:150px;overflow:hidden;">{$item.element}</span>
				</td>				
			</tr> 
			</table>		
			
			<table  class="input_row">				
			<tr>	
				{assign var=item value=$dataPanel.fld_description}	
				<td >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_textarea" style="width:500px;">{$item.element}</span>
				</td>	
							
			</tr> 
			</table>					
	</div>

	

	{if $dataPanel.fld_extend_fields.element}
	<div id="element_tabset_ext" class=" upline" style="width:680px;padding-top:10px;padding-bottom:10px;">
		<h2 class="element_set_title" style="width:680px;"><a id="element_set_btn_ext" class="shrink" href="javascript:;" onclick="switch_elementset('{$form.name}','ext')" >{$dataPanel.fld_extend_fields.elementset}</a></h2>
		<div id="element_set_panel_ext">
		{$dataPanel.fld_extend_fields.element}
		</div>
	</div>
	<script>
			init_elementset('{$form.name}','ext');
	</script>	
	{/if}
	

	{if $dataPanel.fld_project_intro.element}
	<div id="element_tabset_proj" class=" upline" style="width:680px;margin-top:0px;padding-top:10px;padding-bottom:5px;">		
		<h2 class="element_set_title" style="width:680px;"><a id="element_set_btn_proj" class="shrink" href="javascript:;" onclick="switch_elementset('{$form.name}','proj')" >{$dataPanel.fld_project_intro.elementset}</a></h2>
		<div id="element_set_panel_proj">
		{$dataPanel.fld_project_intro.element}
		</div>
	</div>
	<script>
			init_elementset('{$form.name}','proj');
	</script>	
	{/if}

<!-- tab set start -->
	{assign var=ts_counter value=1}
	{foreach item=tabsetdata key=tabsetname name=tabs  from=$form.tabSets}	
	{if $smarty.foreach.tabs.first}
	<div id="element_tabset_{$ts_counter}" class=" upline" style="width:680px;padding-top:10px;padding-bottom:10px;">
	{else}
	<div id="element_tabset_{$ts_counter}" class="underline upline" style="width:680px;padding-top:10px;padding-bottom:10px;">
	{/if}
	<h2 class="element_set_title" style="width:680px;"><a id="element_set_btn_{$ts_counter}" class="shrink" href="javascript:;" onclick="switch_elementset('{$form.name}','{$ts_counter}')" >{$tabsetdata.SetName}</a></h2>						
	<div id="element_set_panel_{$ts_counter}">
	<div style="padding-left:20px;display:none;" id="tabs_{$ts_counter}">	
	<ul style="border-radius: none;">
	{assign var=es_counter value=0}
	{foreach item=setname name=elemsets  from=$tabsetdata.Elems}			
		<li><a href="#element_set_panel_{$ts_counter}_{$es_counter}">{$setname}</a></li>		
		{assign var=es_counter value=$es_counter+1}
	{/foreach}
	</ul>
	{assign var=es_counter value=0}
	{foreach item=setname name=elemsets  from=$tabsetdata.Elems}

		{if $es_counter eq 0 AND $ts_counter eq 1}	
		<div id="element_set_panel_{$ts_counter}_{$es_counter}" class="ui-tabs-panel" style="padding-bottom:0px;">			
		<div style="padding-bottom:15px;">
						
			{assign var=item value=$dataPanel.fld_workhour}		
			<table  class="input_row">				
			<tr>	
				<td style="width:60px;">			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:100px;">{$item.element}</span>
				</td>
			{assign var=item value=$dataPanel.fld_start_time}	
			
				<td style="width:60px;">			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:150px;">{$item.element}</span>
				</td>					
		
			</tr> 
			</table>	
			
			
			{assign var=item value=$dataPanel.fld_actualhour}	
			<table  class="input_row odd" >				
			<tr>	
				<td style="width:60px;" >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:100px;">{$item.element}</span>
				</td>
			{assign var=item value=$dataPanel.fld_finish_time}				
			
				<td style="width:60px;">			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td>
					<span class="label_text" style="width:150px;">{$item.element}</span>
				</td>					
		
			</tr> 
			</table>	
				
			{assign var=item value=$dataPanel.fld_work_log}	
			<table  class="input_row">
			<tr><td align="center" >
				<span class="label_textarea" style="{if $item.width}width:{$item.width+15}px;{else}{if $default_label_textarea_width}{$default_label_textarea_width}{else}width:655px;{/if}{/if}">{$item.element}</span>								
			</td></tr>
			</table>
		
			{if $dataPanel.btn_manage_worklog}
			{assign var=item value=$dataPanel.btn_manage_worklog}	
			<table  class="input_row odd">				
			<tr>	
				
				<td>
					<span class="label_text" style="width:150px;">{$item.element}</span>
				</td>
			
				<td style="width:60px;">			
					<label style="text-align:left;"></label>			
				</td>
				<td>
					<span class="label_text" style="width:150px;"></span>
				</td>					
		
			</tr> 
			</table>	
			{/if}
			</div></div>
		{elseif $es_counter eq 1 AND $ts_counter eq 1}	
		<div id="element_set_panel_{$ts_counter}_{$es_counter}" class="ui-tabs-panel" style="padding-bottom:0px;">			
		<div style="padding-bottom:15px;">
						
			
			
			{assign var=item value=$dataPanel.fld_budget}	
			<table  class="input_row odd" >				
			<tr>	
				<td style="width:60px;" >			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td style="width:180px;">
					<span class="label_text" style="width:100px;">{$item.element}</span>
				</td>
			{assign var=item value=$dataPanel.fld_cost}	
				<td style="width:60px;">			
					<label style="text-align:left;">{$item.label}</label>			
				</td>
				<td style="width:180px;">
					<span class="label_text" style="width:100px;">{$item.element}</span>
				</td>	
			</tr> 
			</table>	
				
			{assign var=item value=$dataPanel.fld_financial_log}	
			<table  class="input_row">
			<tr><td align="center" >
				<span class="label_textarea" style="{if $item.width}width:{$item.width+15}px;{else}{if $default_label_textarea_width}{$default_label_textarea_width}{else}width:655px;{/if}{/if}">{$item.element}</span>								
			</td></tr>
			</table>
		
			{if $dataPanel.btn_manage_financial}
			{assign var=item value=$dataPanel.btn_manage_financial}	
			<table  class="input_row odd">				
			<tr>	
				
				<td>
					<span class="label_text" style="width:150px;">{$item.element}</span>
				</td>
			
				<td style="width:60px;">			
					<label style="text-align:left;"></label>			
				</td>
				<td>
					<span class="label_text" style="width:150px;"></span>
				</td>					
		
			</tr> 
			</table>	
			{/if}
			</div></div>
		{else}
		
        <div id="element_set_panel_{$ts_counter}_{$es_counter}" class="ui-tabs-panel" style="padding-bottom:0px;">			
		<div style="padding-bottom:15px;">
		{assign var=es_elem_counter value=0}
		{foreach item=item key=itemName from=$dataPanel}			
			{if $item.elementset eq $setname AND $item.tabsetcode eq $tabsetname}
			{if $item.type eq 'CKEditor' or $item.type eq 'RichText' 
				or $item.type eq 'Textarea' or $item.type eq 'LabelTextarea'
				or $item.type eq 'HTMLPreview'
				or $item.type eq 'LabelTextarea' or $item.type eq 'LabelImage'
				 or $item.type eq 'RawData'
				 or $item.type eq 'IDCardReader'
				 or $item.type eq 'FormElement'
			}
				<table  id="{$itemName}_container" class="input_row">
				{if $item.label}
				<tr>				
				<td style="width:160px;">	
					<label style="text-align:left;width:160px;">{$item.label}</label>
				</td>				
				<td>
					{if $errors.$itemName}
					<span class="input_error_msg" style="width:240px;">{$errors.$itemName}</span>
					{elseif $item.description}
					<span class="input_desc" style="width:240px;">{$item.description}</span>			
					{/if}
				</td>
				</tr>
				{/if}
				<tr><td colspan="2" align="center" >
					<span class="label_textarea" style="{if $item.width}width:{$item.width+15}px;{else}{if $default_label_textarea_width}{$default_label_textarea_width}{else}width:655px;{/if}{/if}">{$item.element}</span>
								
				</td></tr>
				</table>		
			{else}
				{if $item.type eq 'Hidden' }
				<table  id="{$itemName}_container" class="input_row" style="display:none">
				{else}
					{if $es_elem_counter is odd}
					<table   id="{$itemName}_container" class="input_row odd">
					{else}
					<table   id="{$itemName}_container" class="input_row ">
					{/if}
				{/if}					
				<tr>
				{if $item.label}
				<td style="width:120px;" >	
					<label style="text-align:left">{$item.label}</label>
				</td>
				{/if}
				<td>
				{if $item.type eq 'Checkbox' }
					<span class="label_text" >{$item.element} {$item.description}</span>
				{else}
					<span class="label_text" style="float:left;{if $item.width}width:{$item.width}px;{else}{if $default_label_text_width}{$default_label_text_width}{else}width:270px;{/if}{/if}">{$item.element}</span>
					{if $errors.$itemName}
					<span class="input_error_msg" style="width:200px;">{$errors.$itemName}</span>
					{elseif $item.description}
					<span class="input_desc" style="width:200px;">{$item.description}</span>			
					{/if}				
				{/if}					
					</td>
				</tr>
				</table>
			{/if}
			{assign var=es_elem_counter value=$es_elem_counter+1}					
			{/if}
		{/foreach}
        	</div>
	 			
		</div>
		{/if}


	
	{assign var=es_counter value=$es_counter+1}			
	{/foreach}
	
	<script>
	var formname = '{$form.name}';
	{literal}
	var c_{/literal}{$ts_counter}{literal} = new Cookies();		
	var $tabs_{/literal}{$ts_counter}{literal} = $j( "#tabs_{/literal}{$ts_counter}{literal}" ).tabs({
		select: function(event, ui)
		{				
			c_{/literal}{$ts_counter}{literal}.set(formname+'_lastTab_{/literal}{$ts_counter}{literal}',ui.panel.id);			
		}
	}).css({'padding-left':'0px','width':'680px','display':'block'});		
	lastViewedTab_{/literal}{$ts_counter}{literal} = c_{/literal}{$ts_counter}{literal}.get(formname+'_lastTab_{/literal}{$ts_counter}{literal}');
	$tabs_{/literal}{$ts_counter}{literal}.tabs('select','#'+lastViewedTab_{/literal}{$ts_counter}{literal});
	{/literal}
	</script>
	
	</div></div></div>
		<script>
			init_elementset('{$form.name}','{$ts_counter}');
		</script>	
{assign var=ts_counter value=$ts_counter+1}
{/foreach}
<!-- tab set finished -->

		<div style="height:10px;"></div>
	 	{if $actionPanel|@count > 0}
	 		{if $form.ActionElementSets|@count > 0}
	 		<div class="action_panel_set">
	 			{assign var=es_counter value=0}
			 	{foreach item=setname name=elemsets  from=$form.ActionElementSets}		 		
					 	{if $es_counter is even}
						<p  class="input_row even">
						{else}
						<p  class="input_row ">
						{/if}
						{foreach item=elem from=$actionPanel}
							{if $elem.elementset eq $setname}
								{$elem.element}
							{/if}
						{/foreach}
						</p>		
						{assign var=es_counter value=$es_counter+1}			
			 	{/foreach}
			 </div>
		 	{else}
			<p class="input_row">			
				{foreach item=elem from=$actionPanel}
					{$elem.element}
				{/foreach}
			</p>
			{/if}
		{/if}


	{if $errors}
	    <div id='errorsDiv' class='innerError errorBox'>
	    {foreach item=errMsg from=$errors}
	        <div>{$errMsg}</div>
	    {/foreach}
	    {literal}<script>setTimeout("$('errorsDiv').fade( {from: 1, to: 0});",3000);</script>{/literal}
	    </div>
	{/if}
	
	{if $notices}
	    <div id='noticeDiv' class='noticeBox' >
	    {foreach item=noticeMsg from=$notices}
	        <div>{$noticeMsg}</div>
	    {/foreach}
	    </div>
	    {literal}<script>setTimeout("$('noticeDiv').fade( {from: 1, to: 0});",3000);</script>{/literal}
	{/if}


	
		<div style="height:15px;">
		<div id='{$form.name}.load_disp' style="display:none;">
		<img  src="{$image_url}/form_ajax_loader.gif"/>
		</div>
		</div>
	
</div>
</form>